package lab02.test25;

import java.util.Scanner;

/**
 * Created by lenovo on 2017/11/9.
 */
public class Test {
    public static void main(String[] args) {
        int num1=0;
        int num2=0;
        Scanner scanner=new Scanner(System.in);
        try {
            System.out.println("请输入除数：");
            num1=scanner.nextInt();

            System.out.println("请输入被除数：");
            num2=scanner.nextInt();
        }
        catch (ArithmeticException e){
            System.out.println("类型不正确");
            e.printStackTrace();
        }
        catch (Exception e){
            e.printStackTrace();
        }
        if (num2==0)
        {
            System.out.println("被除数不能为0！！");
        }
        else {
            System.out.println(num1 + " / " + num2 + " = " + (num1 / num2));
        }

    }
}
